--------------------------------------------------------------------------------
      name:  <unnamed>
       log:  R:\Current Research\Markets-Pridemore\Work\MAR07-CrossModels.log
  log type:  text
 opened on:  25 Jun 2024, 16:33:18

. 
. //  program:    Stata 
. //  task:       Cross-Sectional Models 
. //  project:    Markets  
. 
. version
version 17.0

. clear all

. macro drop _all

. set linesize 80

. set more off

. local tag " 06-25-24| Cleaned 06-25-24"

. local file "MAR07-CrossModels"

. local note "|`tag' | `file'"

. local opt "noparen sideway excel noaster  bdec(2)  sdec(2)  pdec(3)   adec(2) 
> e(r2) stats(coef se pval)"

. local dv "lrhom"

. local iv "fraser"

. local iv2 "infantmort" 

. local cont "edu unemp  popdense perurban  sexratio"

. 
. //      #0
. //      Loading data 
. use MAR06-PanelModels.dta, clear 

. 
. //      #1
. //      Setting up 
. gen time=.
(1,524 missing values generated)

. replace time=0 if year<2010
(761 real changes made)

. replace time=1 if year>=2010
(763 real changes made)

. 
. //      #2
. //      collapsing time 1
. preserve 

. drop if time!=0 
(763 observations deleted)

. collapse (mean) `dv' `iv' heritage rol `iv2' `cont' (firstnm) nation regioncod
> e regionname countrycode region subregion region_un region_un_sub region_wb, b
> y(CID) 

. save `file'0.dta, replace 
file MAR07-CrossModels0.dta saved

. restore 

. 
. preserve 

. drop if time!=1
(761 observations deleted)

. collapse (mean) `dv' `iv' heritage rol `iv2' `cont' (firstnm)  nation regionco
> de regionname countrycode region subregion region_un region_un_sub region_wb, 
> by(CID) 

. save `file'1.dta, replace 
file MAR07-CrossModels1.dta saved

. restore 

. 
. //      #3
. //      Loading Time 0 
. use `file'0.dta, clear 

. 
. //      #4
. //      Regression Time 0 
. reg `dv' `iv' `iv2' `cont', beta 

      Source |       SS           df       MS      Number of obs   =        86
-------------+----------------------------------   F(7, 78)        =     10.33
       Model |  70.9018111         7  10.1288302   Prob > F        =    0.0000
    Residual |  76.4586113        78  .980238607   R-squared       =    0.4811
-------------+----------------------------------   Adj R-squared   =    0.4346
       Total |  147.360422        85  1.73365203   Root MSE        =    .99007

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
      fraser |  -.3404303   .1827521    -1.86   0.066                -.1926196
  infantmort |   .0641904    .017799     3.61   0.001                 .4481299
         edu |  -1.969116   1.556271    -1.27   0.210                -.1697034
       unemp |  -.0251234   .0216872    -1.16   0.250                -.1023229
    popdense |  -.0001137   .0001647    -0.69   0.492                -.0604738
    perurban |   .0149079   .0077092     1.93   0.057                 .1964623
    sexratio |  -.0660909    .013127    -5.03   0.000                -.4732846
       _cons |   9.813189    2.20562     4.45   0.000                        .
------------------------------------------------------------------------------

. vif 

    Variable |       VIF       1/VIF  
-------------+----------------------
         edu |      2.70    0.369778
  infantmort |      2.32    0.430819
      fraser |      1.61    0.622131
    perurban |      1.55    0.644468
    sexratio |      1.33    0.752765
       unemp |      1.17    0.852624
    popdense |      1.15    0.866409
-------------+----------------------
    Mean VIF |      1.69

. hettest

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =  15.28
Prob > chi2 = 0.0001

. outreg2 using `file'0, replace `opt' 
MAR07-CrossModels0.xml
dir : seeout

. 
. foreach var in heritage rol {
  2. reg `dv' `var' `iv2' `cont', beta 
  3. vif 
  4. hettest
  5. outreg2 using `file'0, append `opt'
  6. }

      Source |       SS           df       MS      Number of obs   =        84
-------------+----------------------------------   F(7, 76)        =      9.05
       Model |  65.7104865         7  9.38721235   Prob > F        =    0.0000
    Residual |  78.8084707        76  1.03695356   R-squared       =    0.4547
-------------+----------------------------------   Adj R-squared   =    0.4045
       Total |  144.518957        83  1.74119225   Root MSE        =    1.0183

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
    heritage |   .0081996   .0184984     0.44   0.659                 .0509426
  infantmort |   .0644729   .0192222     3.35   0.001                 .4479584
         edu |  -3.229372   1.661545    -1.94   0.056                -.2781379
       unemp |  -.0189905   .0287454    -0.66   0.511                -.0651877
    popdense |  -.0002146   .0001756    -1.22   0.225                -.1152717
    perurban |   .0133246   .0080484     1.66   0.102                 .1752384
    sexratio |  -.0668907     .01372    -4.88   0.000                -.4833247
       _cons |   7.861638   2.127176     3.70   0.000                        .
------------------------------------------------------------------------------

    Variable |       VIF       1/VIF  
-------------+----------------------
         edu |      2.85    0.350369
  infantmort |      2.49    0.402259
    heritage |      1.84    0.543240
    perurban |      1.56    0.640423
    sexratio |      1.37    0.730098
       unemp |      1.36    0.736952
    popdense |      1.24    0.806993
-------------+----------------------
    Mean VIF |      1.82

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =  13.48
Prob > chi2 = 0.0002
MAR07-CrossModels0.xml
dir : seeout

      Source |       SS           df       MS      Number of obs   =        86
-------------+----------------------------------   F(7, 78)        =     11.14
       Model |  73.6689391         7  10.5241342   Prob > F        =    0.0000
    Residual |  73.6914833        78  .944762607   R-squared       =    0.4999
-------------+----------------------------------   Adj R-squared   =    0.4550
       Total |  147.360422        85  1.73365203   Root MSE        =    .97199

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
         rol |  -.4854229   .1899718    -2.56   0.013                -.3541817
  infantmort |   .0456739   .0190808     2.39   0.019                 .3188612
         edu |  -1.211725   1.590494    -0.76   0.448                -.1044296
       unemp |  -.0294163   .0214353    -1.37   0.174                 -.119807
    popdense |   -.000121   .0001594    -0.76   0.450                -.0643501
    perurban |   .0145083   .0075337     1.93   0.058                 .1911966
    sexratio |  -.0607304   .0130051    -4.67   0.000                -.4348976
       _cons |   6.803175   2.017271     3.37   0.001                        .
------------------------------------------------------------------------------

    Variable |       VIF       1/VIF  
-------------+----------------------
         rol |      3.00    0.333697
         edu |      2.93    0.341224
  infantmort |      2.77    0.361313
    perurban |      1.54    0.650435
    sexratio |      1.35    0.739180
       unemp |      1.19    0.841197
    popdense |      1.12    0.891365
-------------+----------------------
    Mean VIF |      1.99

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =   6.07
Prob > chi2 = 0.0138
MAR07-CrossModels0.xml
dir : seeout

. 
. //      #5
. //      Mediating Regression `iv' 
. foreach var in fraser heritage rol {
  2. sem ( `iv2'-> `var', ) (`var' `iv2' -> `dv', ) (`cont' -> `dv', ),  vce(clu
> ster CID) nocapslatent
  3. outreg2 using `file'0, append `opt' 
  4. sem ( `var'-> `iv2', ) (`var' `iv2' -> `dv', ) (`cont' -> `dv', ),  vce(clu
> ster CID) nocapslatent
  5. outreg2 using `file'0, append `opt' 
  6. }

Endogenous variables
  Observed: fraser lrhom

Exogenous variables
  Observed: infantmort edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood = -2020.7176  
Iteration 1:   log pseudolikelihood = -2020.7176  

Structural equation model                                   Number of obs = 86
Estimation method: ml

Log pseudolikelihood = -2020.7176

                                   (Std. err. adjusted for 86 clusters in CID)
------------------------------------------------------------------------------
             |               Robust
             | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
Structural   |
  fraser     |
  infantmort |  -.0380216   .0075831    -5.01   0.000    -.0528842   -.0231589
       _cons |   7.675423   .1112974    68.96   0.000     7.457284    7.893562
  -----------+----------------------------------------------------------------
  lrhom      |
      fraser |  -.3404303   .1660937    -2.05   0.040     -.665968   -.0148927
  infantmort |   .0641904   .0153493     4.18   0.000     .0341063    .0942746
         edu |  -1.969116   1.280005    -1.54   0.124     -4.47788     .539648
       unemp |  -.0251234   .0137448    -1.83   0.068    -.0520627    .0018158
    popdense |  -.0001137    .000066    -1.72   0.085     -.000243    .0000157
    perurban |   .0149079    .006182     2.41   0.016     .0027913    .0270245
    sexratio |  -.0660909   .0112766    -5.86   0.000    -.0881926   -.0439891
       _cons |   9.813189   2.044038     4.80   0.000     5.806949    13.81943
-------------+----------------------------------------------------------------
var(e.fraser)|   .4278349   .0810764                      .2951007    .6202721
 var(e.lrhom)|   .8890536   .2607654                      .5003396     1.57976
------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels0.xml
dir : seeout

Endogenous variables
  Observed: infantmort lrhom

Exogenous variables
  Observed: fraser edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood = -2036.5185  
Iteration 1:   log pseudolikelihood = -2036.5185  

Structural equation model                                   Number of obs = 86
Estimation method: ml

Log pseudolikelihood = -2036.5185

                                    (Std. err. adjusted for 86 clusters in CID)
-------------------------------------------------------------------------------
              |               Robust
              | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
Structural    |
  infantmort  |
       fraser |  -5.788322   1.032288    -5.61   0.000    -7.811569   -3.765075
        _cons |   54.20102   7.811938     6.94   0.000     38.88991    69.51214
  ------------+----------------------------------------------------------------
  lrhom       |
   infantmort |   .0641904   .0153493     4.18   0.000     .0341063    .0942746
       fraser |  -.3404303   .1660937    -2.05   0.040     -.665968   -.0148927
          edu |  -1.969116   1.280005    -1.54   0.124     -4.47788     .539648
        unemp |  -.0251234   .0137448    -1.83   0.068    -.0520627    .0018158
     popdense |  -.0001137    .000066    -1.72   0.085     -.000243    .0000157
     perurban |   .0149079    .006182     2.41   0.016     .0027913    .0270245
     sexratio |  -.0660909   .0112766    -5.86   0.000    -.0881926   -.0439891
        _cons |   9.813189   2.044038     4.80   0.000     5.806949    13.81943
--------------+----------------------------------------------------------------
var(e.infan~t)|    65.1327   14.22207                      42.45558    99.92252
  var(e.lrhom)|   .8890536   .2607654                      .5003396     1.57976
-------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels0.xml
dir : seeout
(2 observations with missing values excluded)

Endogenous variables
  Observed: heritage lrhom

Exogenous variables
  Observed: infantmort edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood =  -2161.805  
Iteration 1:   log pseudolikelihood =  -2161.805  

Structural equation model                                   Number of obs = 84
Estimation method: ml

Log pseudolikelihood = -2161.805

                                    (Std. err. adjusted for 84 clusters in CID)
-------------------------------------------------------------------------------
              |               Robust
              | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
Structural    |
  heritage    |
   infantmort |   -.409877   .0909634    -4.51   0.000    -.5881619   -.2315921
        _cons |   70.57016   1.434983    49.18   0.000     67.75764    73.38267
  ------------+----------------------------------------------------------------
  lrhom       |
     heritage |   .0081996   .0180179     0.46   0.649    -.0271149    .0435141
   infantmort |   .0644729   .0161819     3.98   0.000     .0327569    .0961889
          edu |  -3.229372   1.391498    -2.32   0.020    -5.956657    -.502086
        unemp |  -.0189905   .0213067    -0.89   0.373     -.060751    .0227699
     popdense |  -.0002146   .0000754    -2.85   0.004    -.0003624   -.0000669
     perurban |   .0133246   .0076753     1.74   0.083    -.0017187     .028368
     sexratio |  -.0668907    .011734    -5.70   0.000    -.0898889   -.0438925
        _cons |   7.861638    1.82491     4.31   0.000     4.284881    11.43839
--------------+----------------------------------------------------------------
var(e.herit~e)|   52.45447   8.213323                      38.59236    71.29576
  var(e.lrhom)|   .9381961    .250899                      .5554683     1.58463
-------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels0.xml
dir : seeout
(2 observations with missing values excluded)

Endogenous variables
  Observed: infantmort lrhom

Exogenous variables
  Observed: heritage edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood = -2174.4241  
Iteration 1:   log pseudolikelihood = -2174.4241  

Structural equation model                                   Number of obs = 84
Estimation method: ml

Log pseudolikelihood = -2174.4241

                                    (Std. err. adjusted for 84 clusters in CID)
-------------------------------------------------------------------------------
              |               Robust
              | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
Structural    |
  infantmort  |
     heritage |  -.5126273   .0856082    -5.99   0.000    -.6804163   -.3448382
        _cons |   45.95081   6.087403     7.55   0.000     34.01972     57.8819
  ------------+----------------------------------------------------------------
  lrhom       |
   infantmort |   .0644729   .0161819     3.98   0.000     .0327569    .0961889
     heritage |   .0081996   .0180179     0.46   0.649    -.0271149    .0435141
          edu |  -3.229372   1.391498    -2.32   0.020    -5.956657    -.502086
        unemp |  -.0189905   .0213067    -0.89   0.373     -.060751    .0227699
     popdense |  -.0002146   .0000754    -2.85   0.004    -.0003624   -.0000669
     perurban |   .0133246   .0076753     1.74   0.083    -.0017187     .028368
     sexratio |  -.0668907    .011734    -5.70   0.000    -.0898889   -.0438925
        _cons |   7.861638    1.82491     4.31   0.000     4.284881    11.43839
--------------+----------------------------------------------------------------
var(e.infan~t)|   65.60405   14.83487                      42.11635    102.1905
  var(e.lrhom)|   .9381961    .250899                      .5554683     1.58463
-------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels0.xml
dir : seeout

Endogenous variables
  Observed: rol lrhom

Exogenous variables
  Observed: infantmort edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood =  -2016.444  
Iteration 1:   log pseudolikelihood =  -2016.444  

Structural equation model                                   Number of obs = 86
Estimation method: ml

Log pseudolikelihood = -2016.444

                                   (Std. err. adjusted for 86 clusters in CID)
------------------------------------------------------------------------------
             |               Robust
             | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
Structural   |
  rol        |
  infantmort |  -.0781699   .0122399    -6.39   0.000    -.1021597   -.0541801
       _cons |   1.412861   .1498642     9.43   0.000     1.119132    1.706589
  -----------+----------------------------------------------------------------
  lrhom      |
         rol |  -.4854229    .219236    -2.21   0.027    -.9151175   -.0557284
  infantmort |   .0456739    .017634     2.59   0.010      .011112    .0802358
         edu |  -1.211725    1.56408    -0.77   0.439    -4.277266    1.853815
       unemp |  -.0294163   .0114181    -2.58   0.010    -.0517953   -.0070373
    popdense |   -.000121    .000062    -1.95   0.051    -.0002425    5.42e-07
    perurban |   .0145083    .007551     1.92   0.055    -.0002914    .0293081
    sexratio |  -.0607304   .0109316    -5.56   0.000     -.082156   -.0393048
       _cons |   6.803175   1.686211     4.03   0.000     3.498262    10.10809
-------------+----------------------------------------------------------------
   var(e.rol)|   .4019043   .0749653                      .2788381    .5792862
 var(e.lrhom)|   .8568777   .2097602                      .5303323    1.384489
------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels0.xml
dir : seeout

Endogenous variables
  Observed: infantmort lrhom

Exogenous variables
  Observed: rol edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood =  -2013.025  
Iteration 1:   log pseudolikelihood =  -2013.025  

Structural equation model                                   Number of obs = 86
Estimation method: ml

Log pseudolikelihood = -2013.025

                                    (Std. err. adjusted for 86 clusters in CID)
-------------------------------------------------------------------------------
              |               Robust
              | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
Structural    |
  infantmort  |
          rol |  -7.156411   .6061273   -11.81   0.000    -8.344399   -5.968423
        _cons |   15.63199   .8470942    18.45   0.000     13.97172    17.29226
  ------------+----------------------------------------------------------------
  lrhom       |
   infantmort |   .0456739    .017634     2.59   0.010      .011112    .0802358
          rol |  -.4854229    .219236    -2.21   0.027    -.9151175   -.0557284
          edu |  -1.211725    1.56408    -0.77   0.439    -4.277266    1.853815
        unemp |  -.0294163   .0114181    -2.58   0.010    -.0517953   -.0070373
     popdense |   -.000121    .000062    -1.95   0.051    -.0002425    5.42e-07
     perurban |   .0145083    .007551     1.92   0.055    -.0002914    .0293081
     sexratio |  -.0607304   .0109316    -5.56   0.000     -.082156   -.0393048
        _cons |   6.803175   1.686211     4.03   0.000     3.498262    10.10809
--------------+----------------------------------------------------------------
var(e.infan~t)|    36.7941   12.01887                      19.39687    69.79509
  var(e.lrhom)|   .8568777   .2097602                      .5303323    1.384489
-------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels0.xml
dir : seeout

. 
. //      #6
. //      Moderating 
. foreach var in fraser heritage rol {
  2.         reg `dv' c.`var'##c.`iv2' `cont', beta
  3.         vif
  4.         hettest
  5.         outreg2 using `file'0, append `opt'
  6.         }

      Source |       SS           df       MS      Number of obs   =        86
-------------+----------------------------------   F(8, 77)        =     10.37
       Model |  76.4427541         8  9.55534426   Prob > F        =    0.0000
    Residual |  70.9176683        77  .921008679   R-squared       =    0.5187
-------------+----------------------------------   Adj R-squared   =    0.4687
       Total |  147.360422        85  1.73365203   Root MSE        =    .95969

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
      fraser |  -1.073783    .347525    -3.09   0.003                -.6075591
  infantmort |  -.3408582   .1660369    -2.05   0.043                -2.379619
             |
    c.fraser#|
c.infantmort |   .0585024   .0238514     2.45   0.016                  2.75012
             |
         edu |  -.9759033   1.561923    -0.62   0.534                -.0841058
       unemp |  -.0346768   .0213795    -1.62   0.109                -.1412317
    popdense |  -7.85e-06   .0001654    -0.05   0.962                 -.004175
    perurban |    .016719   .0075091     2.23   0.029                 .2203296
    sexratio |  -.0666612   .0127263    -5.24   0.000                -.4773689
       _cons |   14.36146   2.830077     5.07   0.000                        .
------------------------------------------------------------------------------

    Variable |       VIF       1/VIF  
-------------+----------------------
      fraser |      6.19    0.161647
  infantmort |    214.98    0.004652
    c.fraser#|
c.infantmort |    201.14    0.004972
         edu |      2.90    0.344925
       unemp |      1.21    0.824326
    popdense |      1.24    0.807439
    perurban |      1.57    0.638236
    sexratio |      1.33    0.752514
-------------+----------------------
    Mean VIF |     53.82

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =   4.40
Prob > chi2 = 0.0359
MAR07-CrossModels0.xml
dir : seeout

      Source |       SS           df       MS      Number of obs   =        84
-------------+----------------------------------   F(8, 75)        =      9.06
       Model |  71.0113679         8  8.87642099   Prob > F        =    0.0000
    Residual |  73.5075892        75  .980101189   R-squared       =    0.4914
-------------+----------------------------------   Adj R-squared   =    0.4371
       Total |  144.518957        83  1.74119225   Root MSE        =       .99

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
    heritage |  -.0521496   .0315725    -1.65   0.103                -.3239944
  infantmort |  -.2484428   .1358432    -1.83   0.071                -1.726183
             |
  c.heritage#|
c.infantmort |   .0051362   .0022085     2.33   0.023                 2.130314
             |
         edu |  -2.244848   1.669906    -1.34   0.183                -.1933432
       unemp |  -.0424362   .0297092    -1.43   0.157                -.1456683
    popdense |  -.0000779   .0001805    -0.43   0.667                -.0418184
    perurban |   .0139456   .0078292     1.78   0.079                 .1834049
    sexratio |  -.0665249   .0133395    -4.99   0.000                -.4806813
       _cons |   11.08186   2.488798     4.45   0.000                        .
------------------------------------------------------------------------------

    Variable |       VIF       1/VIF  
-------------+----------------------
    heritage |      5.67    0.176261
  infantmort |    131.36    0.007613
  c.heritage#|
c.infantmort |    123.73    0.008082
         edu |      3.05    0.327852
       unemp |      1.53    0.652091
    popdense |      1.39    0.721363
    perurban |      1.56    0.639678
    sexratio |      1.37    0.729997
-------------+----------------------
    Mean VIF |     33.71

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =   5.59
Prob > chi2 = 0.0180
MAR07-CrossModels0.xml
dir : seeout

      Source |       SS           df       MS      Number of obs   =        86
-------------+----------------------------------   F(8, 77)        =     10.18
       Model |  75.7420697         8  9.46775871   Prob > F        =    0.0000
    Residual |  71.6183527        77  .930108476   R-squared       =    0.5140
-------------+----------------------------------   Adj R-squared   =    0.4635
       Total |  147.360422        85  1.73365203   Root MSE        =    .96442

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
         rol |  -.7884356   .2769891    -2.85   0.006                -.5752704
  infantmort |   .0544975   .0198333     2.75   0.007                 .3804609
             |
       c.rol#|
c.infantmort |   .0304583   .0204014     1.49   0.140                 .2554067
             |
         edu |  -.8200871   1.599765    -0.51   0.610                -.0706772
       unemp |  -.0442258   .0234679    -1.88   0.063                -.1801229
    popdense |  -.0000996   .0001588    -0.63   0.532                -.0529842
    perurban |   .0157838   .0075237     2.10   0.039                 .2080051
    sexratio |  -.0639767   .0130858    -4.89   0.000                -.4581449
       _cons |    6.93402   2.003483     3.46   0.001                        .
------------------------------------------------------------------------------

    Variable |       VIF       1/VIF  
-------------+----------------------
         rol |      6.47    0.154531
  infantmort |      3.04    0.329228
       c.rol#|
c.infantmort |      4.64    0.215666
         edu |      3.01    0.332049
       unemp |      1.45    0.690905
    popdense |      1.13    0.884129
    perurban |      1.56    0.642049
    sexratio |      1.39    0.718770
-------------+----------------------
    Mean VIF |      2.84

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =  10.74
Prob > chi2 = 0.0010
MAR07-CrossModels0.xml
dir : seeout

. 
. //      #7
. //      Qunatile regression 
. foreach var in fraser heritage rol {
  2. sqreg `dv' `var' `iv2' `cont' , quantile(.25 .5 .75 .90) reps(100) 
  3. outreg2 using `file'0-quant, append `opt'
  4. }
(fitting base model)

Bootstrap replications (100)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100

Simultaneous quantile regression                    Number of obs =         86
  bootstrap(100) SEs                                .25 Pseudo R2 =     0.2820
                                                    .50 Pseudo R2 =     0.3871
                                                    .75 Pseudo R2 =     0.3959
                                                    .90 Pseudo R2 =     0.4023

------------------------------------------------------------------------------
             |              Bootstrap
       lrhom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
q25          |
      fraser |  -.5664913   .3005571    -1.88   0.063    -1.164854    .0318719
  infantmort |   .0600994   .0233222     2.58   0.012     .0136684    .1065304
         edu |   .0722054   2.310769     0.03   0.975    -4.528182    4.672593
       unemp |  -.0257499   .0342933    -0.75   0.455    -.0940226    .0425228
    popdense |   .0000676   .0004318     0.16   0.876     -.000792    .0009272
    perurban |   .0109583   .0100412     1.09   0.278    -.0090323    .0309488
    sexratio |  -.0615256   .0189654    -3.24   0.002    -.0992828   -.0237684
       _cons |   9.219585   3.215074     2.87   0.005     2.818864    15.62031
-------------+----------------------------------------------------------------
q50          |
      fraser |  -.4751422   .2503427    -1.90   0.061    -.9735362    .0232519
  infantmort |   .0752463   .0263578     2.85   0.006     .0227719    .1277206
         edu |  -1.983397   1.821663    -1.09   0.280     -5.61005    1.643256
       unemp |  -.0172125   .0225265    -0.76   0.447    -.0620594    .0276343
    popdense |  -.0000295   .0003342    -0.09   0.930    -.0006949    .0006359
    perurban |   .0107381   .0077221     1.39   0.168    -.0046355    .0261117
    sexratio |   -.056452   .0176766    -3.19   0.002    -.0916433   -.0212607
       _cons |   9.907829   3.159355     3.14   0.002     3.618037    16.19762
-------------+----------------------------------------------------------------
q75          |
      fraser |  -.2937874    .208194    -1.41   0.162    -.7082698    .1206951
  infantmort |   .0796976   .0367474     2.17   0.033     .0065392    .1528561
         edu |  -3.899292   2.467859    -1.58   0.118    -8.812422    1.013839
       unemp |  -.0249464   .0361005    -0.69   0.492    -.0968169    .0469242
    popdense |  -.0002264   .0004292    -0.53   0.599    -.0010809     .000628
    perurban |   .0269304   .0112471     2.39   0.019     .0045391    .0493217
    sexratio |  -.0766424   .0204623    -3.75   0.000    -.1173797   -.0359051
       _cons |   11.44598   3.582247     3.20   0.002      4.31428    18.57769
-------------+----------------------------------------------------------------
q90          |
      fraser |  -.2786223   .2092902    -1.33   0.187    -.6952871    .1380424
  infantmort |   .1012438   .0435246     2.33   0.023     .0145929    .1878946
         edu |  -3.001348   2.984962    -1.01   0.318    -8.943951    2.941254
       unemp |   .0279724   .0503643     0.56   0.580    -.0722951      .12824
    popdense |   -.000239    .000484    -0.49   0.623    -.0012025    .0007246
    perurban |   .0168405   .0108626     1.55   0.125    -.0047852    .0384662
    sexratio |  -.0535617   .0176943    -3.03   0.003    -.0887884   -.0183351
       _cons |   9.050757   3.578213     2.53   0.013     1.927083    16.17443
------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels0-quant.xml
dir : seeout
(fitting base model)

Bootstrap replications (100)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100

Simultaneous quantile regression                    Number of obs =         84
  bootstrap(100) SEs                                .25 Pseudo R2 =     0.2456
                                                    .50 Pseudo R2 =     0.3461
                                                    .75 Pseudo R2 =     0.3730
                                                    .90 Pseudo R2 =     0.4074

------------------------------------------------------------------------------
             |              Bootstrap
       lrhom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
q25          |
    heritage |  -.0003971   .0296942    -0.01   0.989    -.0595382     .058744
  infantmort |   .0712953   .0230836     3.09   0.003     .0253203    .1172703
         edu |  -.7656246    1.88082    -0.41   0.685    -4.511602    2.980353
       unemp |  -.0419333   .0378573    -1.11   0.271    -.1173326     .033466
    popdense |  -7.10e-06   .0006383    -0.01   0.991    -.0012783    .0012641
    perurban |   .0007501   .0114787     0.07   0.948    -.0221117    .0236118
    sexratio |  -.0584854   .0283273    -2.06   0.042    -.1149042   -.0020666
       _cons |   6.139972   3.357362     1.83   0.071     -.546794    12.82674
-------------+----------------------------------------------------------------
q50          |
    heritage |   .0056825   .0269139     0.21   0.833    -.0479211    .0592862
  infantmort |   .0989243   .0304214     3.25   0.002     .0383348    .1595138
         edu |  -1.147947   1.695428    -0.68   0.500    -4.524685    2.228792
       unemp |    .009569   .0393299     0.24   0.808    -.0687632    .0879012
    popdense |  -.0000772   .0003981    -0.19   0.847    -.0008701    .0007158
    perurban |   .0082984   .0107096     0.77   0.441    -.0130316    .0296283
    sexratio |  -.0642231   .0275822    -2.33   0.023    -.1191578   -.0092884
       _cons |   5.845915   3.460146     1.69   0.095    -1.045562    12.73739
-------------+----------------------------------------------------------------
q75          |
    heritage |   .0084147   .0278574     0.30   0.763    -.0470683    .0638976
  infantmort |   .0965918   .0362708     2.66   0.009     .0243522    .1688315
         edu |  -4.710926   2.602596    -1.81   0.074    -9.894446    .4725941
       unemp |  -.0169983   .0498837    -0.34   0.734    -.1163503    .0823538
    popdense |  -.0002733    .000617    -0.44   0.659    -.0015021    .0009556
    perurban |   .0203047   .0116086     1.75   0.084    -.0028158    .0434251
    sexratio |  -.0724268    .024258    -2.99   0.004    -.1207408   -.0241128
       _cons |   9.160949   4.040238     2.27   0.026     1.114118    17.20778
-------------+----------------------------------------------------------------
q90          |
    heritage |   .0340774   .0235599     1.45   0.152    -.0128462    .0810011
  infantmort |   .0666648   .0514427     1.30   0.199    -.0357921    .1691218
         edu |  -6.739862   3.519979    -1.91   0.059    -13.75051    .2707831
       unemp |   .0119365   .0661668     0.18   0.857     -.119846    .1437191
    popdense |  -.0004894   .0007821    -0.63   0.533     -.002047    .0010682
    perurban |   .0170985   .0112046     1.53   0.131    -.0052174    .0394144
    sexratio |  -.0691073   .0234409    -2.95   0.004    -.1157938   -.0224208
       _cons |   9.624016   4.968946     1.94   0.056    -.2724982    19.52053
------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels0-quant.xml
dir : seeout
(fitting base model)

Bootstrap replications (100)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100

Simultaneous quantile regression                    Number of obs =         86
  bootstrap(100) SEs                                .25 Pseudo R2 =     0.2980
                                                    .50 Pseudo R2 =     0.3838
                                                    .75 Pseudo R2 =     0.3909
                                                    .90 Pseudo R2 =     0.3900

------------------------------------------------------------------------------
             |              Bootstrap
       lrhom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
q25          |
         rol |  -.4680781   .2643285    -1.77   0.080    -.9943157    .0581594
  infantmort |    .049472   .0302643     1.63   0.106    -.0107795    .1097236
         edu |   1.058875   1.925085     0.55   0.584    -2.773675    4.891425
       unemp |  -.0102265   .0359457    -0.28   0.777     -.081789    .0613359
    popdense |  -.0000232   .0005097    -0.05   0.964     -.001038    .0009917
    perurban |   .0127461   .0099171     1.29   0.203    -.0069974    .0324896
    sexratio |  -.0567316   .0225901    -2.51   0.014     -.101705   -.0117582
       _cons |   4.170657   2.818808     1.48   0.143    -1.441158    9.782473
-------------+----------------------------------------------------------------
q50          |
         rol |  -.5607055   .2382506    -2.35   0.021    -1.035026    -.086385
  infantmort |   .0498934   .0289682     1.72   0.089     -.007778    .1075647
         edu |  -.8011864   1.441714    -0.56   0.580    -3.671418    2.069045
       unemp |  -.0342204   .0221074    -1.55   0.126    -.0782329     .009792
    popdense |  -.0000911   .0003343    -0.27   0.786    -.0007566    .0005744
    perurban |    .010413   .0094313     1.10   0.273    -.0083634    .0291893
    sexratio |  -.0524205   .0186897    -2.80   0.006    -.0896289   -.0152122
       _cons |   5.962741       2.29     2.60   0.011     1.403702    10.52178
-------------+----------------------------------------------------------------
q75          |
         rol |  -.3797688   .3202313    -1.19   0.239      -1.0173    .2577626
  infantmort |   .0708907   .0416046     1.70   0.092    -.0119378    .1537191
         edu |   -3.74375   2.721494    -1.38   0.173    -9.161829    1.674329
       unemp |  -.0367373   .0403797    -0.91   0.366    -.1171271    .0436525
    popdense |  -.0002634   .0005347    -0.49   0.624    -.0013279    .0008012
    perurban |   .0278572    .012084     2.31   0.024     .0037999    .0519146
    sexratio |   -.077127   .0248908    -3.10   0.003    -.1266807   -.0275733
       _cons |    9.64454   3.558863     2.71   0.008     2.559387    16.72969
-------------+----------------------------------------------------------------
q90          |
         rol |  -.0509062   .2746907    -0.19   0.853    -.5977735     .495961
  infantmort |   .0690991   .0480562     1.44   0.154    -.0265734    .1647716
         edu |  -5.452892    3.16555    -1.72   0.089    -11.75502    .8492336
       unemp |  -.0527142   .0607723    -0.87   0.388    -.1737025    .0682741
    popdense |  -.0003778    .000693    -0.55   0.587    -.0017575     .001002
    perurban |   .0125547   .0114425     1.10   0.276    -.0102255    .0353349
    sexratio |  -.0739571   .0259568    -2.85   0.006    -.1256332    -.022281
       _cons |    12.3452   4.739885     2.60   0.011     2.908819    21.78159
------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels0-quant.xml
dir : seeout

. 
. //      #8
. //      Loading second dataset 
. use `file'1.dta, clear 

. 
. //      #9
. //      Regression Time 1 
. reg `dv' `iv' `iv2' `cont', beta 

      Source |       SS           df       MS      Number of obs   =        88
-------------+----------------------------------   F(7, 80)        =     11.46
       Model |  89.5608101         7  12.7944014   Prob > F        =    0.0000
    Residual |  89.2912941        80  1.11614118   R-squared       =    0.5008
-------------+----------------------------------   Adj R-squared   =    0.4571
       Total |  178.852104        87  2.05577131   Root MSE        =    1.0565

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
      fraser |  -.1161798   .1756984    -0.66   0.510                -.0624693
  infantmort |   .1113317   .0270147     4.12   0.000                 .5303616
         edu |  -1.797999   1.756899    -1.02   0.309                -.1360316
       unemp |  -.0279024   .0237317    -1.18   0.243                -.0980148
    popdense |   -.000232   .0001422    -1.63   0.107                -.1364551
    perurban |   .0142205   .0077427     1.84   0.070                 .1758201
    sexratio |  -.0211945   .0048026    -4.41   0.000                -.3977039
       _cons |   3.342558   1.992291     1.68   0.097                        .
------------------------------------------------------------------------------

. vif 

    Variable |       VIF       1/VIF  
-------------+----------------------
         edu |      2.83    0.353209
  infantmort |      2.65    0.376806
    perurban |      1.47    0.680987
      fraser |      1.43    0.699225
    sexratio |      1.30    0.768427
    popdense |      1.12    0.892369
       unemp |      1.11    0.897983
-------------+----------------------
    Mean VIF |      1.70

. hettest

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =   3.64
Prob > chi2 = 0.0562

. outreg2 using `file'1, replace `opt' 
MAR07-CrossModels1.xml
dir : seeout

. 
. foreach var in heritage rol {
  2. reg `dv' `var' `iv2' `cont', beta 
  3. vif 
  4. hettest
  5. outreg2 using `file'1, append `opt'
  6. }

      Source |       SS           df       MS      Number of obs   =        87
-------------+----------------------------------   F(7, 79)        =     11.39
       Model |  89.7673276         7  12.8239039   Prob > F        =    0.0000
    Residual |  88.9300963        79  1.12569742   R-squared       =    0.5023
-------------+----------------------------------   Adj R-squared   =    0.4582
       Total |  178.697424        86  2.07787702   Root MSE        =     1.061

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
    heritage |  -.0149594   .0173528    -0.86   0.391                -.0887327
  infantmort |   .1127349   .0272345     4.14   0.000                 .5372575
         edu |  -1.513237   1.841229    -0.82   0.414                -.1141522
       unemp |  -.0313005   .0261101    -1.20   0.234                -.1016885
    popdense |  -.0002141   .0001465    -1.46   0.148                -.1259909
    perurban |   .0147033   .0077842     1.89   0.063                 .1813273
    sexratio |  -.0206094   .0048783    -4.22   0.000                -.3868839
       _cons |   3.181002   1.839687     1.73   0.088                        .
------------------------------------------------------------------------------

    Variable |       VIF       1/VIF  
-------------+----------------------
         edu |      3.06    0.326538
  infantmort |      2.67    0.373952
    heritage |      1.68    0.594601
    perurban |      1.46    0.683563
    sexratio |      1.33    0.751159
    popdense |      1.18    0.848346
       unemp |      1.14    0.875480
-------------+----------------------
    Mean VIF |      1.79

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =   3.00
Prob > chi2 = 0.0834
MAR07-CrossModels1.xml
dir : seeout

      Source |       SS           df       MS      Number of obs   =        88
-------------+----------------------------------   F(7, 80)        =     13.03
       Model |   95.297841         7  13.6139773   Prob > F        =    0.0000
    Residual |  83.5542632        80  1.04442829   R-squared       =    0.5328
-------------+----------------------------------   Adj R-squared   =    0.4920
       Total |  178.852104        87  2.05577131   Root MSE        =     1.022

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
         rol |  -.4981152   .2040316    -2.44   0.017                -.3267928
  infantmort |   .0966339   .0268281     3.60   0.001                 .4603441
         edu |   .3570064   1.925346     0.19   0.853                 .0270101
       unemp |  -.0299197   .0229724    -1.30   0.197                 -.105101
    popdense |   -.000196   .0001363    -1.44   0.154                 -.115286
    perurban |   .0163339   .0075287     2.17   0.033                 .2019494
    sexratio |  -.0190973    .004721    -4.05   0.000                -.3583511
       _cons |   .8444324   1.833963     0.46   0.646                        .
------------------------------------------------------------------------------

    Variable |       VIF       1/VIF  
-------------+----------------------
         edu |      3.63    0.275212
         rol |      3.07    0.325915
  infantmort |      2.80    0.357518
    perurban |      1.48    0.673970
    sexratio |      1.34    0.744123
       unemp |      1.12    0.896754
    popdense |      1.10    0.908731
-------------+----------------------
    Mean VIF |      2.08

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =   2.30
Prob > chi2 = 0.1296
MAR07-CrossModels1.xml
dir : seeout

. 
. //      #10
. //      Mediating Regression `iv' 
. foreach var in fraser heritage rol {
  2. sem ( `iv2'-> `var', ) (`var' `iv2' -> `dv', ) (`cont' -> `dv', ),  vce(clu
> ster CID) nocapslatent
  3. outreg2 using `file'1, append `opt' 
  4. sem ( `var'-> `iv2', ) (`var' `iv2' -> `dv', ) (`cont' -> `dv', ),  vce(clu
> ster CID) nocapslatent
  5. outreg2 using `file'1, append `opt' 
  6. }

Endogenous variables
  Observed: fraser lrhom

Exogenous variables
  Observed: infantmort edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood = -2150.2082  
Iteration 1:   log pseudolikelihood = -2150.2082  

Structural equation model                                   Number of obs = 88
Estimation method: ml

Log pseudolikelihood = -2150.2082

                                   (Std. err. adjusted for 88 clusters in CID)
------------------------------------------------------------------------------
             |               Robust
             | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
Structural   |
  fraser     |
  infantmort |   -.052357   .0118358    -4.42   0.000    -.0755547   -.0291593
       _cons |   7.820907   .0932742    83.85   0.000     7.638093    8.003721
  -----------+----------------------------------------------------------------
  lrhom      |
      fraser |  -.1161798   .1868953    -0.62   0.534    -.4824879    .2501282
  infantmort |   .1113317   .0198415     5.61   0.000     .0724431    .1502203
         edu |  -1.797999   1.653906    -1.09   0.277    -5.039596    1.443597
       unemp |  -.0279024   .0158198    -1.76   0.078    -.0589087    .0031039
    popdense |   -.000232    .000066    -3.51   0.000    -.0003614   -.0001025
    perurban |   .0142205   .0067409     2.11   0.035     .0010087    .0274324
    sexratio |  -.0211945   .0080588    -2.63   0.009    -.0369893   -.0053996
       _cons |   3.342558   2.192868     1.52   0.127    -.9553853    7.640501
-------------+----------------------------------------------------------------
var(e.fraser)|   .4611672   .1604625                      .2331761    .9120798
 var(e.lrhom)|   1.014674   .1992784                      .6904837    1.491075
------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels1.xml
dir : seeout

Endogenous variables
  Observed: infantmort lrhom

Exogenous variables
  Observed: fraser edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood = -2177.4108  
Iteration 1:   log pseudolikelihood = -2177.4108  

Structural equation model                                   Number of obs = 88
Estimation method: ml

Log pseudolikelihood = -2177.4108

                                    (Std. err. adjusted for 88 clusters in CID)
-------------------------------------------------------------------------------
              |               Robust
              | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
Structural    |
  infantmort  |
       fraser |   -4.10969   .9531116    -4.31   0.000    -5.977754   -2.241626
        _cons |   39.34928   7.193544     5.47   0.000     25.25019    53.44836
  ------------+----------------------------------------------------------------
  lrhom       |
   infantmort |   .1113317   .0198415     5.61   0.000     .0724431    .1502203
       fraser |  -.1161798   .1868953    -0.62   0.534    -.4824879    .2501282
          edu |  -1.797999   1.653906    -1.09   0.277    -5.039596    1.443597
        unemp |  -.0279024   .0158198    -1.76   0.078    -.0589087    .0031039
     popdense |   -.000232    .000066    -3.51   0.000    -.0003614   -.0001025
     perurban |   .0142205   .0067409     2.11   0.035     .0010087    .0274324
     sexratio |  -.0211945   .0080588    -2.63   0.009    -.0369893   -.0053996
        _cons |   3.342558   2.192868     1.52   0.127    -.9553853    7.640501
--------------+----------------------------------------------------------------
var(e.infan~t)|   36.19868   7.257812                      24.43584    53.62386
  var(e.lrhom)|   1.014674   .1992784                      .6904837    1.491075
-------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels1.xml
dir : seeout
(1 observations with missing values excluded)

Endogenous variables
  Observed: heritage lrhom

Exogenous variables
  Observed: infantmort edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood = -2328.2281  
Iteration 1:   log pseudolikelihood = -2328.2281  

Structural equation model                                   Number of obs = 87
Estimation method: ml

Log pseudolikelihood = -2328.2281

                                    (Std. err. adjusted for 87 clusters in CID)
-------------------------------------------------------------------------------
              |               Robust
              | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
Structural    |
  heritage    |
   infantmort |  -.6133145   .1065938    -5.75   0.000    -.8222345   -.4043945
        _cons |   72.15521   1.233675    58.49   0.000     69.73725    74.57316
  ------------+----------------------------------------------------------------
  lrhom       |
     heritage |  -.0149594   .0144869    -1.03   0.302    -.0433531    .0134343
   infantmort |   .1127349   .0204007     5.53   0.000     .0727503    .1527195
          edu |  -1.513237   1.871756    -0.81   0.419    -5.181812    2.155338
        unemp |  -.0313005   .0187517    -1.67   0.095    -.0680532    .0054522
     popdense |  -.0002141   .0000689    -3.11   0.002    -.0003491   -.0000792
     perurban |   .0147033   .0066785     2.20   0.028     .0016137     .027793
     sexratio |  -.0206094    .008071    -2.55   0.011    -.0364283   -.0047905
        _cons |   3.181002   1.778299     1.79   0.074    -.3044011    6.666404
--------------+----------------------------------------------------------------
var(e.herit~e)|   54.71898   10.64684                      37.36949     80.1233
  var(e.lrhom)|   1.022185   .1968647                      .7008013    1.490954
-------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels1.xml
dir : seeout
(1 observations with missing values excluded)

Endogenous variables
  Observed: infantmort lrhom

Exogenous variables
  Observed: heritage edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood = -2348.4017  
Iteration 1:   log pseudolikelihood = -2348.4017  

Structural equation model                                   Number of obs = 87
Estimation method: ml

Log pseudolikelihood = -2348.4017

                                    (Std. err. adjusted for 87 clusters in CID)
-------------------------------------------------------------------------------
              |               Robust
              | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
Structural    |
  infantmort  |
     heritage |  -.3959075    .066004    -6.00   0.000    -.5252729   -.2665421
        _cons |   35.52556   4.774151     7.44   0.000      26.1684    44.88273
  ------------+----------------------------------------------------------------
  lrhom       |
   infantmort |   .1127349   .0204007     5.53   0.000     .0727503    .1527195
     heritage |  -.0149594   .0144869    -1.03   0.302    -.0433531    .0134343
          edu |  -1.513237   1.871756    -0.81   0.419    -5.181812    2.155338
        unemp |  -.0313005   .0187517    -1.67   0.095    -.0680532    .0054522
     popdense |  -.0002141   .0000689    -3.11   0.002    -.0003491   -.0000792
     perurban |   .0147033   .0066785     2.20   0.028     .0016137     .027793
     sexratio |  -.0206094    .008071    -2.55   0.011    -.0364283   -.0047905
        _cons |   3.181002   1.778299     1.79   0.074    -.3044011    6.666404
--------------+----------------------------------------------------------------
var(e.infan~t)|   35.32226   6.321973                      24.87142    50.16449
  var(e.lrhom)|   1.022185   .1968647                      .7008013    1.490954
-------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels1.xml
dir : seeout

Endogenous variables
  Observed: rol lrhom

Exogenous variables
  Observed: infantmort edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood = -2142.4765  
Iteration 1:   log pseudolikelihood = -2142.4765  

Structural equation model                                   Number of obs = 88
Estimation method: ml

Log pseudolikelihood = -2142.4765

                                   (Std. err. adjusted for 88 clusters in CID)
------------------------------------------------------------------------------
             |               Robust
             | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
Structural   |
  rol        |
  infantmort |  -.1000143   .0127608    -7.84   0.000     -.125025   -.0750035
       _cons |   1.372201   .1264394    10.85   0.000     1.124384    1.620018
  -----------+----------------------------------------------------------------
  lrhom      |
         rol |  -.4981152   .1475964    -3.37   0.001    -.7873989   -.2088316
  infantmort |   .0966339   .0197756     4.89   0.000     .0578745    .1353933
         edu |   .3570064   1.953035     0.18   0.855    -3.470871    4.184884
       unemp |  -.0299197   .0156881    -1.91   0.056    -.0606677    .0008283
    popdense |   -.000196   .0000528    -3.71   0.000    -.0002994   -.0000925
    perurban |   .0163339   .0065962     2.48   0.013     .0034056    .0292622
    sexratio |  -.0190973    .007746    -2.47   0.014    -.0342792   -.0039154
       _cons |   .8444324   1.885532     0.45   0.654    -2.851143    4.540007
-------------+----------------------------------------------------------------
   var(e.rol)|   .4134139   .0572081                      .3152071    .5422182
 var(e.lrhom)|   .9494803   .1787934                      .6564461    1.373323
------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels1.xml
dir : seeout

Endogenous variables
  Observed: infantmort lrhom

Exogenous variables
  Observed: rol edu unemp popdense perurban sexratio

Fitting target model:
Iteration 0:   log pseudolikelihood = -2138.4043  
Iteration 1:   log pseudolikelihood = -2138.4043  

Structural equation model                                   Number of obs = 88
Estimation method: ml

Log pseudolikelihood = -2138.4043

                                    (Std. err. adjusted for 88 clusters in CID)
-------------------------------------------------------------------------------
              |               Robust
              | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
--------------+----------------------------------------------------------------
Structural    |
  infantmort  |
          rol |  -5.273306   .4874568   -10.82   0.000    -6.228704   -4.317908
        _cons |   11.57628   .6646632    17.42   0.000     10.27357      12.879
  ------------+----------------------------------------------------------------
  lrhom       |
   infantmort |   .0966339   .0197756     4.89   0.000     .0578745    .1353933
          rol |  -.4981152   .1475964    -3.37   0.001    -.7873989   -.2088316
          edu |   .3570064   1.953035     0.18   0.855    -3.470871    4.184884
        unemp |  -.0299197   .0156881    -1.91   0.056    -.0606677    .0008283
     popdense |   -.000196   .0000528    -3.71   0.000    -.0002994   -.0000925
     perurban |   .0163339   .0065962     2.48   0.013     .0034056    .0292622
     sexratio |  -.0190973    .007746    -2.47   0.014    -.0342792   -.0039154
        _cons |   .8444324   1.885532     0.45   0.654    -2.851143    4.540007
--------------+----------------------------------------------------------------
var(e.infan~t)|   21.79747   5.115503                      13.76079     34.5278
  var(e.lrhom)|   .9494803   .1787934                      .6564461    1.373323
-------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels1.xml
dir : seeout

. 
. //      #11
. //      Moderating 
. foreach var in fraser heritage rol {
  2.         reg `dv' c.`var'##c.`iv2' `cont', beta
  3.         vif
  4.         hettest
  5.         outreg2 using `file'1, append `opt'
  6.         }

      Source |       SS           df       MS      Number of obs   =        88
-------------+----------------------------------   F(8, 79)        =     10.52
       Model |  92.2513497         8  11.5314187   Prob > F        =    0.0000
    Residual |  86.6007545        79  1.09621208   R-squared       =    0.5158
-------------+----------------------------------   Adj R-squared   =    0.4668
       Total |  178.852104        87  2.05577131   Root MSE        =     1.047

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
      fraser |  -.7392667   .4341648    -1.70   0.093                   -.3975
  infantmort |  -.2313487   .2203666    -1.05   0.297                -1.102098
             |
    c.fraser#|
c.infantmort |    .048381   .0308818     1.57   0.121                 1.579831
             |
         edu |  -.6456417   1.890137    -0.34   0.734                -.0488474
       unemp |  -.0260484   .0235486    -1.11   0.272                -.0915022
    popdense |  -.0001533   .0001496    -1.02   0.309                -.0901621
    perurban |   .0145034   .0076754     1.89   0.062                 .1793169
    sexratio |  -.0213204   .0047602    -4.48   0.000                -.4000661
       _cons |   6.993661   3.054447     2.29   0.025                        .
------------------------------------------------------------------------------

    Variable |       VIF       1/VIF  
-------------+----------------------
      fraser |      8.89    0.112465
  infantmort |    179.80    0.005562
    c.fraser#|
c.infantmort |    165.91    0.006027
         edu |      3.34    0.299718
       unemp |      1.12    0.895716
    popdense |      1.26    0.791722
    perurban |      1.47    0.680611
    sexratio |      1.30    0.768208
-------------+----------------------
    Mean VIF |     45.39

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =   1.31
Prob > chi2 = 0.2529
MAR07-CrossModels1.xml
dir : seeout

      Source |       SS           df       MS      Number of obs   =        87
-------------+----------------------------------   F(8, 78)        =     10.41
       Model |  92.2852613         8  11.5356577   Prob > F        =    0.0000
    Residual |  86.4121626        78  1.10784824   R-squared       =    0.5164
-------------+----------------------------------   Adj R-squared   =    0.4668
       Total |  178.697424        86  2.07787702   Root MSE        =    1.0525

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
    heritage |  -.0582397   .0334741    -1.74   0.086                -.3454523
  infantmort |  -.1508081   .1768868    -0.85   0.397                -.7187016
             |
  c.heritage#|
c.infantmort |     .00434   .0028788     1.51   0.136                 1.228002
             |
         edu |  -.4548793   1.956836    -0.23   0.817                -.0343142
       unemp |  -.0396045   .0264814    -1.50   0.139                -.1286664
    popdense |  -.0001399   .0001534    -0.91   0.365                -.0823232
    perurban |   .0161149   .0077788     2.07   0.042                 .1987356
    sexratio |  -.0204984     .00484    -4.24   0.000                 -.384801
       _cons |   5.077594   2.216626     2.29   0.025                        .
------------------------------------------------------------------------------

    Variable |       VIF       1/VIF  
-------------+----------------------
    heritage |      6.36    0.157256
  infantmort |    114.62    0.008724
  c.heritage#|
c.infantmort |    107.02    0.009344
         edu |      3.51    0.284511
       unemp |      1.19    0.837603
    popdense |      1.31    0.760981
    perurban |      1.48    0.673659
    sexratio |      1.33    0.750985
-------------+----------------------
    Mean VIF |     29.61

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =   1.34
Prob > chi2 = 0.2467
MAR07-CrossModels1.xml
dir : seeout

      Source |       SS           df       MS      Number of obs   =        88
-------------+----------------------------------   F(8, 79)        =     11.63
       Model |  96.7371309         8  12.0921414   Prob > F        =    0.0000
    Residual |  82.1149733        79  1.03943004   R-squared       =    0.5409
-------------+----------------------------------   Adj R-squared   =    0.4944
       Total |  178.852104        87  2.05577131   Root MSE        =    1.0195

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
         rol |  -.7334841   .2853725    -2.57   0.012                -.4812085
  infantmort |   .1067941   .0281221     3.80   0.000                 .5087453
             |
       c.rol#|
c.infantmort |   .0335148   .0284814     1.18   0.243                 .1854584
             |
         edu |   .7953134   1.956516     0.41   0.685                 .0601712
       unemp |  -.0393325   .0242732    -1.62   0.109                -.1381659
    popdense |   -.000186   .0001362    -1.37   0.176                -.1094364
    perurban |   .0172054   .0075471     2.28   0.025                  .212724
    sexratio |   -.019977   .0047686    -4.19   0.000                -.3748594
       _cons |   .6393876   1.837849     0.35   0.729                        .
------------------------------------------------------------------------------

    Variable |       VIF       1/VIF  
-------------+----------------------
         rol |      6.03    0.165803
  infantmort |      3.09    0.323816
       c.rol#|
c.infantmort |      4.27    0.233971
         edu |      3.77    0.265237
       unemp |      1.25    0.799367
    popdense |      1.10    0.905234
    perurban |      1.50    0.667480
    sexratio |      1.38    0.725832
-------------+----------------------
    Mean VIF |      2.80

Breusch–Pagan/Cook–Weisberg test for heteroskedasticity 
Assumption: Normal error terms
Variable: Fitted values of lrhom

H0: Constant variance

    chi2(1) =   2.12
Prob > chi2 = 0.1452
MAR07-CrossModels1.xml
dir : seeout

. 
. //      #12
. //      Qunatile regression 
. foreach var in fraser heritage rol {
  2. sqreg `dv' `var' `iv2' `cont' , quantile(.25 .5 .75 .90) reps(100) 
  3. outreg2 using `file'1-quant, append `opt'
  4. }
(fitting base model)

Bootstrap replications (100)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100

Simultaneous quantile regression                    Number of obs =         88
  bootstrap(100) SEs                                .25 Pseudo R2 =     0.2871
                                                    .50 Pseudo R2 =     0.3689
                                                    .75 Pseudo R2 =     0.4255
                                                    .90 Pseudo R2 =     0.4298

------------------------------------------------------------------------------
             |              Bootstrap
       lrhom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
q25          |
      fraser |  -.4181823    .425027    -0.98   0.328    -1.264013    .4276484
  infantmort |   .0965786   .0257648     3.75   0.000      .045305    .1478522
         edu |  -1.884526   2.485238    -0.76   0.451    -6.830308    3.061256
       unemp |  -.0133142   .0320854    -0.41   0.679    -.0771662    .0505378
    popdense |  -.0000322   .0005297    -0.06   0.952    -.0010863    .0010219
    perurban |   .0097681   .0084141     1.16   0.249    -.0069766    .0265127
    sexratio |  -.0443364   .0270817    -1.64   0.106    -.0982308     .009558
       _cons |   7.778867    4.46701     1.74   0.085    -1.110767     16.6685
-------------+----------------------------------------------------------------
q50          |
      fraser |  -.4462331   .2253962    -1.98   0.051    -.8947858    .0023196
  infantmort |   .1023271   .0257803     3.97   0.000     .0510227    .1536315
         edu |  -1.587773   2.092116    -0.76   0.450    -5.751217     2.57567
       unemp |  -.0190067   .0170308    -1.12   0.268    -.0528991    .0148858
    popdense |  -.0001028   .0003352    -0.31   0.760    -.0007698    .0005643
    perurban |   .0114884   .0090498     1.27   0.208    -.0065212     .029498
    sexratio |  -.0280807   .0242709    -1.16   0.251    -.0763814      .02022
       _cons |   6.378748   3.393126     1.88   0.064     -.373787    13.13128
-------------+----------------------------------------------------------------
q75          |
      fraser |  -.1866362   .1866253    -1.00   0.320    -.5580324    .1847601
  infantmort |   .0937493   .0439847     2.13   0.036     .0062169    .1812817
         edu |  -4.481524   2.421821    -1.85   0.068    -9.301101    .3380527
       unemp |  -.0497222   .0364955    -1.36   0.177    -.1223505    .0229061
    popdense |   -.000303    .000467    -0.65   0.518    -.0012324    .0006264
    perurban |   .0226679   .0079104     2.87   0.005     .0069258    .0384101
    sexratio |  -.0188506   .0229743    -0.82   0.414     -.064571    .0268698
       _cons |   6.031696   3.605513     1.67   0.098    -1.143503    13.20689
-------------+----------------------------------------------------------------
q90          |
      fraser |   .1033938   .2858411     0.36   0.719    -.4654482    .6722358
  infantmort |   .1352199   .0603167     2.24   0.028     .0151857     .255254
         edu |  -4.353027   3.061297    -1.42   0.159     -10.4452    1.739148
       unemp |  -.0690299   .0644017    -1.07   0.287    -.1971934    .0591337
    popdense |  -.0004532   .0007003    -0.65   0.519    -.0018468    .0009404
    perurban |   .0323506   .0146267     2.21   0.030     .0032427    .0614586
    sexratio |  -.0230593   .0215792    -1.07   0.288    -.0660034    .0198848
       _cons |   4.018204    4.52381     0.89   0.377    -4.984465    13.02087
------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels1-quant.xml
dir : seeout
(fitting base model)

Bootstrap replications (100)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100

Simultaneous quantile regression                    Number of obs =         87
  bootstrap(100) SEs                                .25 Pseudo R2 =     0.3058
                                                    .50 Pseudo R2 =     0.3668
                                                    .75 Pseudo R2 =     0.4166
                                                    .90 Pseudo R2 =     0.4285

------------------------------------------------------------------------------
             |              Bootstrap
       lrhom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
q25          |
    heritage |  -.0443297   .0190024    -2.33   0.022    -.0821531   -.0065063
  infantmort |   .1244642   .0326512     3.81   0.000     .0594735    .1894549
         edu |   1.617667    2.14696     0.75   0.453    -2.655751    5.891085
       unemp |  -.0287619   .0259078    -1.11   0.270    -.0803301    .0228062
    popdense |   .0000401   .0007049     0.06   0.955    -.0013629    .0014432
    perurban |   .0034771   .0067913     0.51   0.610    -.0100406    .0169949
    sexratio |  -.0383685   .0222658    -1.72   0.089    -.0826875    .0059506
       _cons |   4.558344   2.692403     1.69   0.094    -.8007499    9.917438
-------------+----------------------------------------------------------------
q50          |
    heritage |   -.023066   .0186688    -1.24   0.220    -.0602253    .0140933
  infantmort |   .1105599   .0313258     3.53   0.001     .0482075    .1729123
         edu |  -1.764182   2.693718    -0.65   0.514    -7.125893    3.597529
       unemp |   -.038937   .0200497    -1.94   0.056     -.078845     .000971
    popdense |  -.0001265   .0003316    -0.38   0.704    -.0007866    .0005336
    perurban |   .0102737    .008999     1.14   0.257    -.0076384    .0281858
    sexratio |  -.0254805   .0209408    -1.22   0.227    -.0671621    .0162011
       _cons |   4.724048   2.784337     1.70   0.094     -.818037    10.26613
-------------+----------------------------------------------------------------
q75          |
    heritage |  -.0164933   .0137224    -1.20   0.233     -.043807    .0108204
  infantmort |   .1139122   .0435105     2.62   0.011     .0273067    .2005177
         edu |  -4.164249   2.719012    -1.53   0.130    -9.576306    1.247808
       unemp |  -.0491783   .0308218    -1.60   0.115    -.1105276    .0121709
    popdense |  -.0002951   .0005236    -0.56   0.575    -.0013374    .0007471
    perurban |   .0242788   .0072761     3.34   0.001     .0097961    .0387616
    sexratio |  -.0186343   .0231429    -0.81   0.423    -.0646991    .0274304
       _cons |   5.297994   3.282261     1.61   0.110    -1.235182    11.83117
-------------+----------------------------------------------------------------
q90          |
    heritage |   .0095867   .0185432     0.52   0.607    -.0273226     .046496
  infantmort |   .1216077   .0627298     1.94   0.056    -.0032529    .2464682
         edu |  -4.573385   3.371183    -1.36   0.179    -11.28356    2.136787
       unemp |  -.0522846   .0595561    -0.88   0.383    -.1708281    .0662589
    popdense |  -.0004511   .0007699    -0.59   0.560    -.0019835    .0010813
    perurban |   .0264355   .0142049     1.86   0.066    -.0018388    .0547097
    sexratio |  -.0226343   .0208172    -1.09   0.280    -.0640699    .0188014
       _cons |   4.754697   4.020828     1.18   0.241    -3.248561    12.75796
------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels1-quant.xml
dir : seeout
(fitting base model)

Bootstrap replications (100)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100

Simultaneous quantile regression                    Number of obs =         88
  bootstrap(100) SEs                                .25 Pseudo R2 =     0.2981
                                                    .50 Pseudo R2 =     0.3855
                                                    .75 Pseudo R2 =     0.4390
                                                    .90 Pseudo R2 =     0.4234

------------------------------------------------------------------------------
             |              Bootstrap
       lrhom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
q25          |
         rol |  -.3892656    .259361    -1.50   0.137    -.9054103    .1268792
  infantmort |   .1114898   .0418796     2.66   0.009     .0281468    .1948328
         edu |    1.77169    2.78298     0.64   0.526    -3.766617    7.309996
       unemp |  -.0538403   .0334491    -1.61   0.111    -.1204061    .0127256
    popdense |  -.0000494   .0004371    -0.11   0.910    -.0009192    .0008203
    perurban |   .0055633   .0089982     0.62   0.538    -.0123438    .0234703
    sexratio |  -.0387447    .022363    -1.73   0.087    -.0832483     .005759
       _cons |   1.855917   3.650901     0.51   0.613    -5.409607    9.121441
-------------+----------------------------------------------------------------
q50          |
         rol |  -.5261384   .1887939    -2.79   0.007    -.9018502   -.1504267
  infantmort |   .1143682   .0280188     4.08   0.000     .0586091    .1701274
         edu |   2.017172   2.519371     0.80   0.426    -2.996537    7.030881
       unemp |  -.0234659   .0186706    -1.26   0.212    -.0606216    .0136899
    popdense |  -.0001074   .0002754    -0.39   0.698    -.0006554    .0004407
    perurban |   .0076294   .0099694     0.77   0.446    -.0122103     .027469
    sexratio |  -.0213669    .017908    -1.19   0.236     -.057005    .0142712
       _cons |   .1071598   2.938523     0.04   0.971    -5.740688    5.955008
-------------+----------------------------------------------------------------
q75          |
         rol |  -.3282603   .1671404    -1.96   0.053    -.6608803    .0043596
  infantmort |   .0912554   .0418802     2.18   0.032     .0079112    .1745996
         edu |  -3.819955    2.50494    -1.52   0.131    -8.804946    1.165035
       unemp |  -.0582103   .0434903    -1.34   0.185    -.1447587    .0283381
    popdense |   -.000301   .0004366    -0.69   0.493    -.0011699     .000568
    perurban |    .024159    .008484     2.85   0.006     .0072752    .0410428
    sexratio |  -.0183596   .0189195    -0.97   0.335    -.0560106    .0192915
       _cons |    4.25034   3.263128     1.30   0.196    -2.243492    10.74417
-------------+----------------------------------------------------------------
q90          |
         rol |    .103795   .3437036     0.30   0.763    -.5801969    .7877869
  infantmort |   .1291305   .0600937     2.15   0.035     .0095402    .2487209
         edu |  -4.828364   2.937969    -1.64   0.104    -10.67511    1.018382
       unemp |  -.0783939   .0567401    -1.38   0.171    -.1913103    .0345224
    popdense |  -.0004555   .0006999    -0.65   0.517    -.0018483    .0009373
    perurban |   .0312861   .0142224     2.20   0.031     .0029827    .0595895
    sexratio |   -.023886   .0206427    -1.16   0.251    -.0649662    .0171942
       _cons |   5.395797   3.667324     1.47   0.145    -1.902409      12.694
------------------------------------------------------------------------------
check eret list for the existence of e(r2)
MAR07-CrossModels1-quant.xml
dir : seeout

. 
. //      #13
. //      save and close 
. save `file'.dta, replace 
(file MAR07-CrossModels.dta not found)
file MAR07-CrossModels.dta saved

. log close 
      name:  <unnamed>
       log:  R:\Current Research\Markets-Pridemore\Work\MAR07-CrossModels.log
  log type:  text
 closed on:  25 Jun 2024, 16:36:28
--------------------------------------------------------------------------------
